package com.tg.service.eventbus;

import com.google.common.eventbus.EventBus;
import org.springframework.beans.factory.InitializingBean;

import java.util.List;

/**
 * Created by linzc on 2018/9/20.
 */
public class EventBusAdapter extends EventBus {

    private List<EventHandler> eventBusListener;

    public void setEventBusListener(List<EventHandler> eventBusListener) {
        this.eventBusListener = eventBusListener;
    }
//
//    @Override
//    public void afterPropertiesSet() throws Exception {
////        for(EventHandler eventAbstract : eventBusListener){
////            this.register(eventAbstract);
////        }
//    }

    public void goon(){
        for(EventHandler eventAbstract : eventBusListener){
            this.register(eventAbstract);
        }
    }

    public List<EventHandler> getEventBusListener() {
        return eventBusListener;
    }
}

